<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin:*");

$session = $_GET["session"] ?? "";

if (!$session || !file_exists("history/".$session)) {
    echo json_encode(["error" => "该历史不存在"]);
    exit;
}

echo file_get_contents("history/".$session);
?>
